package com.tianji.promotion.controller;


import com.tianji.common.domain.dto.PageDTO;
import com.tianji.promotion.domain.query.CodeQuery;
import com.tianji.promotion.domain.vo.ExchangeCodeVo;
import com.tianji.promotion.service.IExchangeCodeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 兑换码 前端控制器
 * </p>
 *
 * @author xzh
 * @since 2024-03-20
 */
@RestController
@RequestMapping("/codes")
@Api(tags = "兑换码相关接口")
@RequiredArgsConstructor(onConstructor_ = {@Lazy})
public class ExchangeCodeController {

    private final IExchangeCodeService exchangeCodeService;

    /**
     * 兑换码分页查询
     * @param query
     * @return
     */
    @GetMapping("/page")
    @ApiOperation(value = "兑换码分页查询")
    public PageDTO<ExchangeCodeVo> queryExchangeCodePage(CodeQuery query){
        return exchangeCodeService.queryExchangeCodePage(query);
    }
}
